//对常用的函数进行封装

/**
 * 对象类型数据映射
 */
export const dataMapper = <Tnew, Told extends Tnew>(oldData: Told): Tnew => {
  const Target: Tnew = oldData
  return Target
}

//按照时间判断是否早上、上午、下午、晚上
export const getTime = () => {
  let message = ''
  const hours = new Date().getHours()
  if (hours <= 9) {
    message = '早上'
  } else if (hours <= 12) {
    message = '上午'
  } else if (hours <= 18) {
    message = '下午'
  } else {
    message = '晚上'
  }
  return message
}
